#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include <gl/gl.h>
#include <gl/glu.h>

#include "png.hpp"

class Texture
{
public:
    Texture(const char* filename, bool hasAlpha = false);
    ~Texture();

    void read(const char* filename, bool hasAlpha);

    int getId() const;
    int getWidth() const;
    int getHeight() const;

    bool hasAlpha();

private:

    void upload();

    char* _pixels;
    int _id;
    int _width, _height;
    bool _hasAlpha;
};

#endif // _TEXTURE_H_
